package org.wxf.action;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.wxf.bean.AdminInfoBean;
import org.wxf.service.impl.LoginServiceImpl;
import org.wxf.utils.MyUtils;

/**
 * Servlet implementation class DelUsermessageAction
 */
@WebServlet("/DelUsermessageAction")
public class DelUsermessageAction extends HttpServlet {
	private static final long serialVersionUID = 1L;
	/**
	 * 删除管理信息
	 * @author dell
	 *
	 */
		protected void service(HttpServletRequest request, HttpServletResponse response)
				throws ServletException, IOException {
			// 1、接收表单数据
			AdminInfoBean adminB = MyUtils.convertFormData2Bean(request, AdminInfoBean.class);
			// 2、调用service层进行数据保存
			int i = MyUtils.getInstance(LoginServiceImpl.class).saveOrDeleteusermessage(adminB);
			// 3、根据保存处理结果进行页面转发
		// ajax响应
					// 响应客户单的请求
					PrintWriter pw = response.getWriter();
					// 将json字符串发回客户端浏览器
					pw.write("delok");
					pw.flush();
					pw.close();
		}


}
